HAL MMC macro migration

This section provides information about the HAL MMC macros migration.

HAL public macros have been removed. The HAL2 driver provides equivalent static inline APIs of the HAL1 macros.

Related Concept: Removal of hardware-related macros in HAL2

HAL MMC reset handle state macro

HAL1

HAL2

#define __HAL_MMC_RESET_HANDLE_STATE(__HANDLE__)
Removed; use HAL_MMC_DeInit(hal_mmc_handle_t *hmmc) instead

HAL MMC interrupt enable/disable macros

HAL1

HAL2

#define __HAL_MMC_ENABLE_IT(__HANDLE__, __INTERRUPT__)
#define __HAL_MMC_DISABLE_IT(__HANDLE__, __INTERRUPT__)
Removed; use __STATIC_INLINE void HAL_MMC_EnableIT(hal_mmc_handle_t *hmmc, uint32_t interrupt) instead
Removed; use __STATIC_INLINE void HAL_MMC_DisableIT(hal_mmc_handle_t *hmmc, uint32_t interrupt) instead

HAL MMC get flag/interrupt macros

Note

In both HAL1 and HAL2, flags and interrupts are internally handled by HAL driver within the process functions; normally, application code does not need to check flags or interrupts status directly.

In HAL1, the following macros are used for flag and interrupt management:

  • __HAL_MMC_GET_FLAG: Retrieves the status of any MMC flag by passing the desired flag as a parameter.

  • __HAL_MMC_GET_IT: Specifically retrieves the status of MMC interrupt flags by passing the appropriate interrupt flag.

In HAL2, the __HAL_MMC_GET_IT macro has been removed. Instead, users should use the HAL_MMC_IsActiveFlag() function for all cases (both general flags and interrupt flags) by providing the correct flag as an argument.

HAL1

HAL2

#define __HAL_MMC_GET_FLAG(__HANDLE__, __FLAG__)
#define __HAL_MMC_GET_IT(__HANDLE__, __INTERRUPT__)
Removed; use __STATIC_INLINE uint32_t HAL_MMC_IsActiveFlag(const hal_mmc_handle_t *hmmc, uint32_t flag) instead.
Removed; use HAL_MMC_IsActiveFlag()  with the appropriate IT mask instead.

HAL MMC clear flag/interrupt macros

Note

In both HAL1 and HAL2, flags and interrupts are internally handled by HAL driver within the process functions; normally, application code does not need to check flags or interrupts status directly.

In HAL1, the following macros are used for flag and interrupt management:

  • __HAL_MMC_CLEAR_FLAG: Clears the status of any MMC flag by passing the desired flag as a parameter.

  • __HAL_MMC_CLEAR_IT: Specifically clears the status of MMC interrupt flags by passing the appropriate interrupt flag.

In HAL2, the __HAL_MMC_CLEAR_IT macro has been removed. Instead, users should use the HAL_MMC_ClearFlag() function for all cases (both general flags and interrupt flags) by providing the correct flag as an argument.

HAL1

HAL2

#define __HAL_MMC_CLEAR_FLAG(__HANDLE__, __FLAG__)
#define __HAL_MMC_CLEAR_IT(__HANDLE__, __INTERRUPT__)
Removed; use __STATIC_INLINE void HAL_MMC_ClearFlag(hal_mmc_handle_t *hmmc, uint32_t flag) instead.
Removed; use HAL_MMC_ClearFlag() with the appropriate IT mask instead.

HAL MMC enable macro

HAL1

HAL2

__HAL_MMC_ENABLE(__HANDLE__)
__HAL_MMC_DISABLE(__HANDLE__)
__HAL_MMC_DMA_ENABLE(__HANDLE__)
__HAL_MMC_DMA_DISABLE(__HANDLE__)

Peripheral enabling/disabling and DMA enabling/disabling are handled internally by the HAL driver.